package com.pen.interfece.mapper;

import com.github.pagehelper.Page;
import com.pen.interfece.pojo.dto.illPageQueryDTO;
import com.pen.interfece.pojo.entity.Admin;
import com.pen.interfece.pojo.entity.ill;
import com.pen.interfece.pojo.entity.userLogin;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserMapper {

    @Select("select * from user where account=#{account}")
    userLogin getByAccount(userLogin userlogin);

    @Select("select account from user where id=#{id}")
    String pageQuery(Long id);
    @Insert("insert into user(account,password,nickname,phone,sex,time) " +
            "values"+
            "(#{account}, #{password},#{nickName}, #{phone},#{sex},#{time})")
    void register(Admin admin);

    Page<ill> selectIll(illPageQueryDTO ill);
    @Insert("insert into ill(name,detail,img,methods,userid,time,confidence) " +
            "values"+
            "(#{name}, #{detail},#{img}, #{methods},#{userid},#{time},#{confidence})")
    void save(ill i);

    void update(Admin admin);
}
